class MedicFirstAidKit extends FirstAidKit;

var bool bActive;

auto state Pickup
{
    function Touch( actor Other )
    {
        local Pawn P;
        local PlayerController PC;
		local KFPCServ IPC;
		local float AwardHeal,OldHealth;
		
		if ( !bActive )
			return;

        P = Pawn(Other);
		IPC = KFPCServ(Instigator.Controller);
		
        if(P!=none)
        {
			PC = PlayerController(P.Controller);

			if ( ValidTouch(Other) && (P.Health <= P.HealthMax - 25) )
			{
				SRHumanPawn(P).TakeHealing(IPC,15,30*KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo).ClientVeteranSkill.Static.GetHealPotency(KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo))-15,1.00);
				AnnouncePickup(P);
				SetRespawn();
				bActive = false;
			}
//			else if ( P.Health >= P.HealthMax - 25 && PlayerController(P.Controller) != none )
//				PlayerController(P.Controller).ClientMessage("You need to have 25 health lost or more to use this medkit.", 'KFCriticalEvent');
		}
    }
}

simulated function Tick(float DT)
{
	if ( !bActive )
	{
		Destroy();
	}
	Super.Tick(DT);
}

function AnnouncePickup( Pawn Receiver )
{
    Receiver.HandlePickup(self);
    PlaySound( PickupSound,SLOT_Interact,2*100,,100 );
}

defaultproperties
{
     DrawScale=0.80
	 HealingAmount=30
	 RespawnTime=2000000.0
	 bActive=true
}
